package bomber.view;

import javax.swing.JFrame;
import bomber.init.AppInit;


/** application main view class */
public class AppView extends JFrame {

	private static final long serialVersionUID = 1L;
	private AppInit appInit;
	private String appName;


	/** constructor arguments: program name, initiation class */
	public AppView(String appName, AppInit appInit) {

		//setting:
		super(appName);
		this.setVisible(true);
		this.setResizable(true);

		//references:
		this.appName = appName;
		this.appInit = appInit;

		//components:
		this.initView();
		this.pack();
		this.setLocationRelativeTo(null);
		this.setDefaultCloseOperation(3);
	}


	private void initView() {
		super.add(new GamePanel(this.appInit.newGame(), this.appName));
	}
}
